import { createRouter, createWebHashHistory } from 'vue-router'
import HomeView from '../views/home.vue'

const router = createRouter({
  history: createWebHashHistory(),
  routes: [
    {
      path: '/',
      name: 'home',
      component: HomeView,
    },
    {
      path: '/verify',
      name: 'verify',
      component: () => {
        console.log('[Router] 开始加载 verify 组件')
        return import('../views/verify.vue').then(module => {
          console.log('[Router] verify 组件加载成功')
          return module
        }).catch(err => {
          console.error('[Router] verify 组件加载失败:', err)
          throw err
        })
      },
    },
    // {
    //   path: '/socket-test',
    //   name: 'socket-test',
    //   component: () => import('../views/socket-test.vue'),
    // },
  ],
})

export default router
